import { defineStore } from 'pinia'

export const useCountStore =  defineStore('count',{
    //actions放置的是动作方法，用于响应组件中的操作
    actions: {
        increment(value) {
            if(this.sum < 20){
                this.sum += value
            }
            
        },
        decrement(value) {
            this.sum -= value
        },
    },
    state: () => {
        return {
            sum: 1,
            name:'荒',
            niko:'罪血大凶'
        }
    }
})